<link rel="stylesheet" type="text/css" href="resource/css/calendar.css?v=0.01">
<link rel="stylesheet" href="resource/css/swiper.min.css" />
<script type="text/javascript" src="resource/js/swiper.min.js" ></script>
<link rel="stylesheet" type="text/css" href="resource/css/myslider.css">
<script type="text/javascript"  src="resource/js/main.js"></script>

<style>
    .footer-home{display: none}
</style>
<header>
    <a href="javascript:history.back(-1);" style="color: #fff">
        <i class="iconfont icon-xialalan-copy"></i>
    </a>
    <span><?php echo $output['hotel_info']['hotel_name']; ?></span>
</header>


        <div class="margin_bot home-slide swiper-container" onclick="window.location.href='index.php?act=hotel&op=hotel_images&ht_id=<?php echo $output['hotel_info']['id']; ?>' ">

            <ul class="slider swiper-wrapper">
                <?php if($output['images']){ ?>
            <?php foreach($output['images'] as $key =>$vo){?>
                <li class="swiper-slide"><img src="<?php echo $vo['img_path']; ?>" /></li>
            <?php  }?>
                <?php }else{ ?>
                    <img src="resource/images/hotel.jpg" />
                <?php  }?>
            </ul>

        </div>

<div class="contect">

    <ul class="ul_mar">
        <li class="ul_info" onclick="checkMap('<?php echo $output['hotel_info']['ht_full_addr']; ?>','<?php echo HOST_URL; ?>')" >
            <i class="fl icon_1 iconfont icon-diliweizhi"></i><span class="p-2"><?php echo $output['hotel_info']['ht_full_addr']; ?></span>
            <a <!--href="index.php?act=map&op=index&addr=--><?php /*echo $output['hotel_info']['ht_full_addr']; */?>"  class="fr font_s">
                <span class="connect">地图</span>
                <span class="rotate iconfont icon-xialalan-copy font_s"></span>
            </a>
        </li>
        <li class="ul_info" onclick="window.location.href='tel:<?php echo $output['hotel_info']['hotel_tel']; ?>'" >
            <i class="icon_1 iconfont icon-dianhua"></i><?php echo $output['hotel_info']['hotel_tel']; ?>
            <a  class="fr font_s">
                <span class="connect">联系</span>
                <span class="rotate iconfont icon-xialalan-copy font_s"></span>
            </a>
        </li>
    </ul>
    <div class="ul_mar">
        <div class="de_title ">
            <p class="ul_line">设施详情</p>
            <a href="index.php?act=hotel&op=hotel_info&type=facility&hotel_id=<?php echo $output['hotel_info']['id']; ?>" class="fr font_s">
                <span class="connect">设施/详情</span>
                <span class="rotate iconfont icon-xialalan-copy font_s"></span>
            </a>
        </div>
        <div class="de_title">
            <div class="de_title">
                <span class="span_mar"><i class="icon_1 iconfont icon-wifi"></i>免费WiFi</span>
                <span class="span_mar"><i class="icon_1 iconfont icon-reshui"></i>全天热水</span>
                <span class="span_mar"><i class="icon_1 iconfont icon-kongtiaogongcheng"></i>空调</span>
                <span class="span_mar"><i class="icon_1 iconfont icon-chuifengji"></i>吹风机</span>
            </div>
            <div class="ui-tab">
                <div id="info-manager-content" class="info-shrink-text">
                <?php echo $output['hotel_info']['hotel_content']; ?>
                </div>
                <div class="div_1"><i class="more-text iconfont icon-xialalan"></i></div>
            </div>
        </div>
    </div>
    <div id="checkinout">
        <div id="firstSelect" style="width:100%;">
            <div class="Date_lr" style="float:left;">
                <P>入住</p>
                <input id="startDate" type="text" value="" style="" readonly="readonly">
            </div>
            <div class="Date_lr" style="float:right;">
                <p>离店</p>
                <input id="endDate" type="text" value="" style="" readonly="readonly">
            </div>
            <span class="span21">共<span class="NumDate"><?php echo $output['hotel_time']['numdate'] ?></span>晚</span>
        </div>
    </div>
    <div class="mask_calendar">
        <div class="calendar"></div>
    </div>
    <div class="room_list">
        <ul class="room_ul">
            <?php foreach($output['spec_list'] as $key =>$value){ ?>
                <?php if($value['open_spec']==0){ ?>
                    <!-- 房型底下没有规格的 -->
            <li >
                <a  class="hotel_spec" spec_id="<?php echo $value['spec_id']; ?>" >
                    <div class="room_pic">
                        <img src="<?php echo $value['surface_img']; ?>" alt="房间"/>
                        <span><?php echo $value['img_sum']; ?></span>
                    </div>
                    <span class="room_title"><?php echo $value['spec_name']; ?></span>
                    <span class="area p-1"><?php echo $value['floorage']; ?>M<sup>2</sup> <?php echo $value['label']; ?></span>
                    <span class="dis">优惠已减<i class="iconfont icon-renminbi"><?php echo $value['market_price']-$value['price']; ?></i></span>
                    <span class="money  "><i class="iconfont icon-renminbi"><?php echo $value['price']; ?></i></span>
                    <span class="price_1"><i class=" iconfont icon-renminbi"><?php echo $value['market_price']; ?></i></span>
                </a>
                    <?php if($value['close']==1){?>
                        <a class="noboking" >预定</a>
                    <?php }else{ ?>
                        <?php if($value['stock']<=$value['sold_num']){?>
                            <a class="noboking" >预定</a>
                        <?php }else{ ?>
                            <a class="booking" href="index.php?act=hotel&op=place_info&hotel_id=<?php echo $output['hotel_info']['id']; ?>&spec_id=<?php echo $value['spec_id']; ?>">预定</a>
                        <?php } ?>
                    <?php } ?>

            </li>
            <?php }else{ ?>
                    <!-- 房型底下开启规格的 -->
                    <li>
                        <a  class="hotel_spec"  spec_id="<?php echo $value['spec_id']; ?>">
                            <div class="room_pic">
                                <img src="<?php echo $value['surface_img']; ?>" alt="房间"/>
                                <span><?php echo $value['img_sum']; ?></span>
                            </div>
                            <span class="room_title"><?php echo $value['spec_name']; ?></span>
                            <span class="area"><?php echo $value['floorage']; ?>M<sup>2</sup> <?php echo $value['label']; ?></span>
                            <span class="dis">优惠已减<i class="iconfont icon-renminbi"><?php echo $value['market_price']-$value['price']; ?></i></span>
                            <span class="money "><i class="iconfont icon-renminbi"><?php echo $value['price']; ?></i></span>
                        </a>
                        <span class="more"><i class="rotate iconfont icon-xialalan"></i></span>
                    </li>
                    <ul class="room_more" style="display:none;">
                        <?php foreach($value['find_list'] as $item=>$vo) {?>
                        <li>
                            <h2><?php echo $vo['spec_name'] ?><i class="rotate iconfont icon-xialalan-copy"></i></h2>
                            <h4 ><?php echo $vo['label']; ?></h4>
                            <h5 >不可取消</h5>
                            <span class="money "><i class="iconfont icon-renminbi"><?php echo $vo['price']; ?></i></span>
                            <span class="price_1"><i class=" iconfont icon-renminbi"><?php echo $vo['market_price']; ?></i></span>
                            <?php if($value['close']==1){?>
                                <!-- 属于该时间段关闭的房型 -->
                                <a class="noboking" >预定</a>
                            <?php }else{ ?>
                                <?php if($value['stock']<=$value['sold_num']){?>
                                    <!-- 属于没房型关闭的房间 -->
                                    <a class="noboking" >预定</a>
                                <?php }else{ ?>
                                    <a class="booking" href="index.php?act=hotel&op=place_info&hotel_id=<?php echo $output['hotel_info']['id']; ?>&spec_id=<?php echo $vo['spec_id']; ?>">预定</a>
                                <?php } ?>
                            <?php } ?>

                        </li>
                        <?php  }?>
                    </ul>

                    <?php  }?>
           <?php } ?>

    </div>

    <!-- 评论-->
    <?php if($output['cmt_list']): ?>
    <div class="comment">
        <div class="de_title">住客评价（<?php echo $output['cot_count']; ?>）<i class="rotate iconfont icon-xialalan-copy fr"></i></div>

        <ul class="com_detail">

                <?php foreach($output['cmt_list'] as $key => $value): ?>
            <li>
                <div content="c_title"><span class="pingf"><?php echo $value['all_point']; ?></span><?php echo $value['member_name']; ?></div>
                <h5 class=""><?php echo date('Y-m-d',$value['addtime']); ?>发表</h5>
                <p class=""><?php echo $value['content'] ?></p>
            </li>
                <?php endforeach; ?>

        </ul>

        <div class="com_more">
            <a href="index.php?act=comment&op=index&g_id=<?php echo $output['hotel_info']['id']; ?>&type_id=<?php echo HOTEL_MARK;  ?>">查看全部住客点评</a>
        </div>
    </div>
    <?php  endif;?>
</div>

<!--加载中遮罩层-->
<div id="caseBlanche_box" style="display: none;z-index: 1005;" >
    <div id="caseBlanche">
        <div id="rond">
            <div id="test"></div>
        </div>
        <div id="load">
            <p>loading</p>
        </div>
    </div>
</div>
<div class="holl" style="z-index: 1005;">

</div>
<script type="text/javascript" src="resource/js/date.js?v=1.56"></script>
<script src="resource/js/jquery.mySlider.js"></script>
<script>
    //入住日期
    $(function(){
        $('#firstSelect').on('click',function () {
            $('.mask_calendar').show();
        });
        $('.mask_calendar').on('click',function (e) {
            if(e.target.className == "mask_calendar"){
                $('.calendar').slideUp(200);
                $('.mask_calendar').fadeOut(200);
            }
        })
        $('#firstSelect').calendarSwitch({
            selectors : {
                sections : ".calendar"
            },
            index : 6,      //展示的月份个数
            animateFunction : "slideToggle",        //动画效果
            controlDay:true,//知否控制在daysnumber天之内，这个数值的设置前提是总显示天数大于90天
            daysnumber : "130",     //控制天数
            comeColor : "#3FACEF",       //入住颜色
            outColor : "#3FACEF",      //离店颜色
            comeoutColor : "#C1DEF0",        //入住和离店之间的颜色
            callback :function(){//回调函数
                $('.mask_calendar').fadeOut(200);
                var startDate = $('#startDate').val();  //入住的天数
                var endDate = $('#endDate').val();      //离店的天数
                var NumDate = $('.NumDate').text();    //共多少晚
                var startDate = startDate.replace("年0","");//替换显示
                var startDate = startDate.replace("年1","");//替换显示
                $('#startDate').val(startDate);
                console.log(startDate);
                console.log(endDate);
                console.log(NumDate);
                //下面做ajax请求
                //show_loading();
                $.post("index.php?act=hotel&op=edit_check_time",{startdate:startDate, enddate:endDate, numdate:NumDate},function(data){
                    location.reload();
                },'json');
            }  ,
            comfireBtn:'.comfire'//确定按钮的class或者id
        });
        var b=new Date();
        var ye=b.getFullYear();
        var mo=b.getMonth()+1;
        mo = mo<10?"0"+mo:mo;
        var da=b.getDate();
        da = da<10?"0"+da:da;
        $('#startDate').val("<?php echo $output['hotel_time']['startdate']; ?>");
        b=new Date(b.getTime()+24*3600*1000);
        var ye=b.getFullYear();
        var mo=b.getMonth()+1;
        mo = mo<10?"0"+mo:mo;
        var da=b.getDate();
        da = da<10?"0"+da:da;
        $('#endDate').val("<?php echo  $output['hotel_time']['enddate']; ?>");
    });
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true,
        loop: true,
        autoplay: 3000,
        autoplayDisableOnInteraction: false
    });
    var swiper = new Swiper('.swiper-container_1', {
        pagination: '.swiper-pagination1',
        paginationClickable: true,
        loop: true,
        autoplay: 3000,
        autoplayDisableOnInteraction: false
    });
    //多房间展示
    var i=1;
    $(".more").click(function () {
        $(this).parent().next(".room_more").slideToggle();
        $(this).find(".rotate").css("transform","rotate("+i*-180+"deg)");
        ++i;
    });
    //点击查看房型详情
    $(function(){
        $(".hotel_spec").click(function(){
            var spec_id = $(this).attr('spec_id');
            $("#caseBlanche_box").show();
            $.get('index.php?act=hotel&op=get_room',{spec_id:spec_id},function(data){
                $("#caseBlanche_box").hide();
                $(".holl").append(data);
                $(".holl").show();
            });
        });
        $('.holl').click(function(){
            //清空所有html
            $(".holl").empty();
            $(".holl").hide();
        });
    });

</script>